# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DriveActivity.V2.Model.Create do
  @moduledoc """
  An object was created.

  ## Attributes

  *   `copy` (*type:* `GoogleApi.DriveActivity.V2.Model.Copy.t`, *default:* `nil`) - If present, indicates the object was created by copying an existing Drive object.
  *   `new` (*type:* `GoogleApi.DriveActivity.V2.Model.New.t`, *default:* `nil`) - If present, indicates the object was newly created (e.g. as a blank document), not derived from a Drive object or external object.
  *   `upload` (*type:* `GoogleApi.DriveActivity.V2.Model.Upload.t`, *default:* `nil`) - If present, indicates the object originated externally and was uploaded to Drive.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :copy => GoogleApi.DriveActivity.V2.Model.Copy.t() | nil,
          :new => GoogleApi.DriveActivity.V2.Model.New.t() | nil,
          :upload => GoogleApi.DriveActivity.V2.Model.Upload.t() | nil
        }

  field(:copy, as: GoogleApi.DriveActivity.V2.Model.Copy)
  field(:new, as: GoogleApi.DriveActivity.V2.Model.New)
  field(:upload, as: GoogleApi.DriveActivity.V2.Model.Upload)
end

defimpl Poison.Decoder, for: GoogleApi.DriveActivity.V2.Model.Create do
  def decode(value, options) do
    GoogleApi.DriveActivity.V2.Model.Create.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DriveActivity.V2.Model.Create do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
